from multiprocessing import Process
from time import sleep


class ClockProcess(Process):
    def __init__(self, interval):
        # Process.__init__(self)
        super().__init__()
        self.interval = interval

    def run(self):
        print("sub process is running!")
        sleep(self.interval)


if __name__ == "__main__":
    print("mian process start")
    p1 = ClockProcess(3)
    p1.start()
    p1.join()
    print("mian process end")
